//
//  ShareMaMapView.m
//  Yihubang
//
//  Created by xmy on 16/9/14.
//  Copyright © 2016年 jinghao. All rights reserved.
//

#import "ShareMaMapView.h"

@implementation ShareMaMapView
static MAMapView *_ShareMaMapView = nil;

+ (MAMapView *)shareMAMapView {
    @synchronized(self) {
        if (_ShareMaMapView == nil) {
            CGRect frame = [[UIScreen mainScreen] bounds];
            _ShareMaMapView = [[MAMapView alloc] initWithFrame:frame];
            _ShareMaMapView.autoresizingMask =
            UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
//            _ShareMaMapView.showsUserLocation = YES;
            //      _mapView.rotateEnabled = YES;
            //      _mapView.rotateCameraEnabled = YES;
            _ShareMaMapView.zoomEnabled = YES;
        }
        _ShareMaMapView.frame = [UIScreen mainScreen].bounds;
        return _ShareMaMapView;
    }
}


//重写allocWithZone保证分配内存alloc相同
//+ (id)allocWithZone:(NSZone *)zone {
//    @synchronized(self) {
//        
//        if (_mapView == nil) {
//            _mapView = [super allocWithZone:zone];
//            return _mapView; // assignment and return on first allocation
//        }
//    }
//    return nil; // on subsequent allocation attempts return nil
//}
//
////保证copy相同
//+ (id)copyWithZone:(NSZone *)zone {
//    return _mapView;
//}
@end
